BACnet Templating
Introduction
BACnet templating is mostly used to enable so called auto-configuring of BACnet devices and BACnet objects. Auto-configuring is currently enabled for those gatewayed protocols:
- MBus
- Pelican Wireless
- wMBus
- LoRaWAN
Auto-configuration is performed such that when device of any of the above protocols appear first time in Peripheral Manager a message is sent to the BACnet manager of DINGO-Stack. That message holds information about the device type (by device nami in Peripheral Manager). The BACnet manager searches for a pre-configured template for that device type and creates a virtual BACnet device from the template.
How a device appears in Peripheral Manager is protocol specific. For MBus and Pelican Wireless some manual or regular automatic pulling for devices on the bus has to be performed. Therefore this is called "semi auto-configuration".
For wMBus and LoRaWAN it is different, as devices in this protocol are supposed to push notifications to the Peripheral Manager as JSON objects. This is called "full auto-configuration".
Below BACnet templating example will be used for LoRaWAN only. However that description can as well be applied for the other auto-configured protocols.
Template Gateway and Active Gateway
It is important to understand the difference between a "template gateway" and an "active gateway". The Screenshot below explains the difference.
Notice how the "yellow" template BACnet device "800 (ELSYS ERSCO2)" has been used to auto-create active virtual BACnet devices with instance number 804, 808 and 811.
The gateway named "LoRaWAN Templates" is a disabled gateway (field "Enabled" unchecked) and holds all the yellow virtual BACnet devices. Those are presented as yellow dingos because the filed "Template" is checked (screenshot below).
The field "Peripheral device" is set automatically as the first "Present value" property in an BACnet object in the template device is linked to a device port in Peripheral Manager.
NOTE! Normally you should not use the "Change..." button unless you are dealing with many template variants for the same device type, that should be avoided.
For further information refer to the "BACnet device" section.
Create a Template BACnet Device
Same methods apply when creating template BACnet devices as when creating an normal active device under a virtual gateway as discussed in the sections BACnet device, BACnet object and BACnet object property above. Copy and paste, drag and drop can be used when creating BACnet templates just like when creating normal BACnet devices, objects and properties.
However there are some rules to follow:
Name: The name of the virtual gateway can be anything. However it is good practise to name it the same name as the peripheral bus as shown in the screenshot above.
Bus: This is the peripheral bus holding the peripheral templated devices. The peripheral buses available are dependant on the controller attached to the top-level device.
DNET: Not relevant for template gateways. Can be set to any number.
Enabled: This should always be set to unchecked (disabled).
Autoconfigured: For future use.
The template device object name has to be exactly the same as the name of the template device in Peripheral Manager.
The best way to secure this is to copy it from the peripheral template and paste it into the BACnet template. This is demonstrated on the screenshot(s) below.
Be careful when changing the name either in the BACnet template or peripheral template to do the same thing in the other too.
The template BACnet device objects are created the same way as other BACnet device objects as described in section "BACnet object" .
It has to be remembered to link all "Present value" properties to a port in the peripherals, unless it is linked to something fixed outside templating.
In some cases it may be applicable to link also other properties to peripheral ports, like "Unit" (for example Pelican Wireless temperatures °C / °F).
NOTE! It is very important that all BACnet property-links to peripheral ports within the same BACnet device template refer to peripheral ports within the same peripheral device template.
BACnet device templates may hold trend-log and/or trend-log-multiple objects, for the purpose of trend-logging from any of the other objects within the same BACnet template device.
However when auto-configuration happens from trend-log og trend-log-multiple the active object is created in the main BACnet device. This is explained in the screenshot below.
Also notice that "tl-" is prepended at the active object's name.
This special case is more natural than keepin the trend-logs in the active virtual BACnet device, as that would not reflect very well tha physical device for example a temperature / humidity sensor.
The concept here is to "log from" the device keeping the main BACnet device as a host for all trend-logs.